documentation
[lhc/web/wiklou.git] / includes / Profiling.php
index ca81ec0..014f678 100755 (executable)
@@ -1,4 +1,4 @@
-<?php 
+<?php
 /**
  * This file is only included if profiling is enabled
  * @package MediaWiki
@@ -44,7 +44,7 @@ if (!function_exists('memory_get_usage')) {
 class Profiler {
        var $mStack = array (), $mWorkStack = array (), $mCollated = array ();
        var $mCalls = array (), $mTotals = array ();
-       
+
        function Profiler()
        {
                // Push an entry for the pre-profile setup time onto the stack
@@ -55,7 +55,7 @@ class Profiler {
                } else {
                        $this->profileIn( '-total' );
                }
-                       
+
        }
 
        function profileIn($functionname) {
@@ -172,12 +172,12 @@ class Profiler {
                        trim( sprintf( "%7.3f", $delta * 1000.0 ) ),
                        $space, $fname );
        }
-       
+
        function micro2Float( $micro ) {
                list( $whole, $fractional ) = explode( ' ', $micro );
                return (float)$whole + (float)$fractional;
        }
-       
+
        function microDelta( $start, $end ) {
                return $this->micro2Float( $end ) -
                       $this->micro2Float( $start );
@@ -193,7 +193,7 @@ class Profiler {
                return $ru['ru_utime.tv_sec'].' '.$ru['ru_utime.tv_usec'] / 1e6;
        }
 
-       function getFunctionReport() {          
+       function getFunctionReport() {
                $width = 140;
                $nameWidth = $width - 65;
                $format =      "%-{$nameWidth}s %6d %13.3f %13.3f %13.3f%% %9d  (%13.3f -%13.3f) [%d]\n";
@@ -335,14 +335,14 @@ class Profiler {
 
                $rc = $dbw->affectedRows();
                if ($rc == 0) {
-                       $dbw->insert('profiling', array ('pf_name' => $name, 'pf_count' => $eventCount, 
+                       $dbw->insert('profiling', array ('pf_name' => $name, 'pf_count' => $eventCount,
                                'pf_time' => $timeSum, 'pf_server' => $wguname['nodename'] ), $fname, array ('IGNORE'));
                }
                // When we upgrade to mysql 4.1, the insert+update
                // can be merged into just a insert with this construct added:
                //     "ON DUPLICATE KEY UPDATE ".
                //     "pf_count=pf_count + VALUES(pf_count), ".
-               //     "pf_time=pf_time + VALUES(pf_time)"; 
+               //     "pf_time=pf_time + VALUES(pf_time)";
        }
 
        /**